package com.cms.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.cms.entity.PageTemplates;
import com.cms.entity.PageTemplatesExample;
import com.common.ibatis.BaseDao;
@Repository
public class PageTemplatesDAOImpl extends BaseDao implements PageTemplatesDAO {

    
    public PageTemplatesDAOImpl() {
        super();
    }

    public void insert(PageTemplates record) {
        getSqlMapClientTemplate().insert("page_templates.abatorgenerated_insert", record);
    }

    
    public int updateByPrimaryKey(PageTemplates record) {
        int rows = getSqlMapClientTemplate().update("page_templates.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    
    public int updateByPrimaryKeySelective(PageTemplates record) {
        int rows = getSqlMapClientTemplate().update("page_templates.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

   
    public List selectByExample(PageTemplatesExample example) {
        List list = getSqlMapClientTemplate().queryForList("page_templates.abatorgenerated_selectByExample", example);
        return list;
    }

    
    public PageTemplates selectByPrimaryKey(Integer id) {
        PageTemplates key = new PageTemplates();
        key.setId(id);
        PageTemplates record = (PageTemplates) getSqlMapClientTemplate().queryForObject("page_templates.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    public int deleteByExample(PageTemplatesExample example) {
        int rows = getSqlMapClientTemplate().delete("page_templates.abatorgenerated_deleteByExample", example);
        return rows;
    }

    
    public int deleteByPrimaryKey(Integer id) {
        PageTemplates key = new PageTemplates();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("page_templates.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

   
    public int countByExample(PageTemplatesExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("page_templates.abatorgenerated_countByExample", example);
        return count.intValue();
    }

    
    public int updateByExampleSelective(PageTemplates record, PageTemplatesExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("page_templates.abatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    
    public int updateByExample(PageTemplates record, PageTemplatesExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("page_templates.abatorgenerated_updateByExample", parms);
        return rows;
    }

   
    private static class UpdateByExampleParms extends PageTemplatesExample {
        private Object record;

        public UpdateByExampleParms(Object record, PageTemplatesExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }


}